using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using SJXmlP.XMLClasses;
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using yW5Lib;

namespace yWriter6
{
	[DesignerGenerated]
	public class frmPresets : Form
	{
		private IContainer components;

		[CompilerGenerated]
		[AccessedThroughProperty("lblExport")]
		private Label _lblExport;

		[CompilerGenerated]
		[AccessedThroughProperty("Label1")]
		private Label _Label1;

		[CompilerGenerated]
		[AccessedThroughProperty("cmbFilterList")]
		private ComboBox _cmbFilterList;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdSave")]
		private Button _cmdSave;

		[CompilerGenerated]
		[AccessedThroughProperty("txtExportName")]
		private TextBox _txtExportName;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdDelete")]
		private Button _cmdDelete;

		[CompilerGenerated]
		[AccessedThroughProperty("lstExport")]
		private ListView _lstExport;

		[CompilerGenerated]
		[AccessedThroughProperty("ColumnHeader1")]
		private ColumnHeader _ColumnHeader1;

		[CompilerGenerated]
		[AccessedThroughProperty("lstDoNotExport")]
		private ListView _lstDoNotExport;

		[CompilerGenerated]
		[AccessedThroughProperty("ColumnHeader2")]
		private ColumnHeader _ColumnHeader2;

		[CompilerGenerated]
		[AccessedThroughProperty("Label2")]
		private Label _Label2;

		[CompilerGenerated]
		[AccessedThroughProperty("txtExportFilename")]
		private TextBox _txtExportFilename;

		[CompilerGenerated]
		[AccessedThroughProperty("Label3")]
		private Label _Label3;

		[CompilerGenerated]
		[AccessedThroughProperty("Label4")]
		private Label _Label4;

		[CompilerGenerated]
		[AccessedThroughProperty("Label5")]
		private Label _Label5;

		[CompilerGenerated]
		[AccessedThroughProperty("ToolTip1")]
		private ToolTip _ToolTip1;

		[CompilerGenerated]
		[AccessedThroughProperty("fraMobiEpub")]
		private GroupBox _fraMobiEpub;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdEditMobiEpub")]
		private Button _cmdEditMobiEpub;

		[CompilerGenerated]
		[AccessedThroughProperty("cmbExporters")]
		private ComboBox _cmbExporters;

		[CompilerGenerated]
		[AccessedThroughProperty("chkExportMobiFormat")]
		private CheckBox _chkExportMobiFormat;

		[CompilerGenerated]
		[AccessedThroughProperty("chkExportEpubFormat")]
		private CheckBox _chkExportEpubFormat;

		[CompilerGenerated]
		[AccessedThroughProperty("chkShowMobiEpubSelect")]
		private CheckBox _chkShowMobiEpubSelect;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdClose")]
		private Button _cmdClose;

		private clsProject cProject;

		private bool SuppressUpdate;

		private clsCollection<int> colExpIDs;

		public string ExporterName;

		[field: AccessedThroughProperty("lblExport")]
		internal virtual Label lblExport
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label1")]
		internal virtual Label Label1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ComboBox cmbFilterList
		{
			[CompilerGenerated]
			get
			{
				return _cmbFilterList;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmbSaved_SelectedIndexChanged;
				ComboBox cmbFilterList = _cmbFilterList;
				if (cmbFilterList != null)
				{
					cmbFilterList.SelectedIndexChanged -= value2;
				}
				_cmbFilterList = value;
				cmbFilterList = _cmbFilterList;
				if (cmbFilterList != null)
				{
					cmbFilterList.SelectedIndexChanged += value2;
				}
			}
		}

		internal virtual Button cmdSave
		{
			[CompilerGenerated]
			get
			{
				return _cmdSave;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdSave_Click;
				Button cmdSave = _cmdSave;
				if (cmdSave != null)
				{
					cmdSave.Click -= value2;
				}
				_cmdSave = value;
				cmdSave = _cmdSave;
				if (cmdSave != null)
				{
					cmdSave.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("txtExportName")]
		internal virtual TextBox txtExportName
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual Button cmdDelete
		{
			[CompilerGenerated]
			get
			{
				return _cmdDelete;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdDelete_Click;
				Button cmdDelete = _cmdDelete;
				if (cmdDelete != null)
				{
					cmdDelete.Click -= value2;
				}
				_cmdDelete = value;
				cmdDelete = _cmdDelete;
				if (cmdDelete != null)
				{
					cmdDelete.Click += value2;
				}
			}
		}

		internal virtual ListView lstExport
		{
			[CompilerGenerated]
			get
			{
				return _lstExport;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				DragEventHandler value2 = lstExport_DragDrop;
				DragEventHandler value3 = lstExport_DragOver;
				ItemDragEventHandler value4 = lstExport_ItemDrag;
				EventHandler value5 = lstExport_SelectedIndexChanged;
				ListView lstExport = _lstExport;
				if (lstExport != null)
				{
					lstExport.DragDrop -= value2;
					lstExport.DragOver -= value3;
					lstExport.ItemDrag -= value4;
					lstExport.SelectedIndexChanged -= value5;
				}
				_lstExport = value;
				lstExport = _lstExport;
				if (lstExport != null)
				{
					lstExport.DragDrop += value2;
					lstExport.DragOver += value3;
					lstExport.ItemDrag += value4;
					lstExport.SelectedIndexChanged += value5;
				}
			}
		}

		[field: AccessedThroughProperty("ColumnHeader1")]
		internal virtual ColumnHeader ColumnHeader1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ListView lstDoNotExport
		{
			[CompilerGenerated]
			get
			{
				return _lstDoNotExport;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				DragEventHandler value2 = lstDoNotExport_DragDrop;
				DragEventHandler value3 = lstDoNotExport_DragOver;
				ItemDragEventHandler value4 = lstDoNotExport_ItemDrag;
				ListView lstDoNotExport = _lstDoNotExport;
				if (lstDoNotExport != null)
				{
					lstDoNotExport.DragDrop -= value2;
					lstDoNotExport.DragOver -= value3;
					lstDoNotExport.ItemDrag -= value4;
				}
				_lstDoNotExport = value;
				lstDoNotExport = _lstDoNotExport;
				if (lstDoNotExport != null)
				{
					lstDoNotExport.DragDrop += value2;
					lstDoNotExport.DragOver += value3;
					lstDoNotExport.ItemDrag += value4;
				}
			}
		}

		[field: AccessedThroughProperty("ColumnHeader2")]
		internal virtual ColumnHeader ColumnHeader2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label2")]
		internal virtual Label Label2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("txtExportFilename")]
		internal virtual TextBox txtExportFilename
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label3")]
		internal virtual Label Label3
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label4")]
		internal virtual Label Label4
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label5")]
		internal virtual Label Label5
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("ToolTip1")]
		internal virtual ToolTip ToolTip1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("fraMobiEpub")]
		internal virtual GroupBox fraMobiEpub
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual Button cmdEditMobiEpub
		{
			[CompilerGenerated]
			get
			{
				return _cmdEditMobiEpub;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdEditMobiEpub_Click;
				Button cmdEditMobiEpub = _cmdEditMobiEpub;
				if (cmdEditMobiEpub != null)
				{
					cmdEditMobiEpub.Click -= value2;
				}
				_cmdEditMobiEpub = value;
				cmdEditMobiEpub = _cmdEditMobiEpub;
				if (cmdEditMobiEpub != null)
				{
					cmdEditMobiEpub.Click += value2;
				}
			}
		}

		internal virtual ComboBox cmbExporters
		{
			[CompilerGenerated]
			get
			{
				return _cmbExporters;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmbExporters_SelectedIndexChanged;
				ComboBox cmbExporters = _cmbExporters;
				if (cmbExporters != null)
				{
					cmbExporters.SelectedIndexChanged -= value2;
				}
				_cmbExporters = value;
				cmbExporters = _cmbExporters;
				if (cmbExporters != null)
				{
					cmbExporters.SelectedIndexChanged += value2;
				}
			}
		}

		[field: AccessedThroughProperty("chkExportMobiFormat")]
		internal virtual CheckBox chkExportMobiFormat
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("chkExportEpubFormat")]
		internal virtual CheckBox chkExportEpubFormat
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual CheckBox chkShowMobiEpubSelect
		{
			[CompilerGenerated]
			get
			{
				return _chkShowMobiEpubSelect;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = chkMobiEpub_CheckedChanged;
				CheckBox chkShowMobiEpubSelect = _chkShowMobiEpubSelect;
				if (chkShowMobiEpubSelect != null)
				{
					chkShowMobiEpubSelect.CheckedChanged -= value2;
				}
				_chkShowMobiEpubSelect = value;
				chkShowMobiEpubSelect = _chkShowMobiEpubSelect;
				if (chkShowMobiEpubSelect != null)
				{
					chkShowMobiEpubSelect.CheckedChanged += value2;
				}
			}
		}

		internal virtual Button cmdClose
		{
			[CompilerGenerated]
			get
			{
				return _cmdClose;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdClose_Click;
				Button cmdClose = _cmdClose;
				if (cmdClose != null)
				{
					cmdClose.Click -= value2;
				}
				_cmdClose = value;
				cmdClose = _cmdClose;
				if (cmdClose != null)
				{
					cmdClose.Click += value2;
				}
			}
		}

		[DebuggerNonUserCode]
		protected override void Dispose(bool disposing)
		{
			try
			{
				if (disposing && components != null)
				{
					components.Dispose();
				}
			}
			finally
			{
				base.Dispose(disposing);
			}
		}

		[System.Diagnostics.DebuggerStepThrough]
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
			lblExport = new System.Windows.Forms.Label();
			Label1 = new System.Windows.Forms.Label();
			cmbFilterList = new System.Windows.Forms.ComboBox();
			cmdSave = new System.Windows.Forms.Button();
			txtExportName = new System.Windows.Forms.TextBox();
			cmdDelete = new System.Windows.Forms.Button();
			lstExport = new System.Windows.Forms.ListView();
			ColumnHeader1 = new System.Windows.Forms.ColumnHeader();
			lstDoNotExport = new System.Windows.Forms.ListView();
			ColumnHeader2 = new System.Windows.Forms.ColumnHeader();
			Label2 = new System.Windows.Forms.Label();
			txtExportFilename = new System.Windows.Forms.TextBox();
			Label3 = new System.Windows.Forms.Label();
			Label4 = new System.Windows.Forms.Label();
			Label5 = new System.Windows.Forms.Label();
			ToolTip1 = new System.Windows.Forms.ToolTip(components);
			fraMobiEpub = new System.Windows.Forms.GroupBox();
			cmdEditMobiEpub = new System.Windows.Forms.Button();
			cmbExporters = new System.Windows.Forms.ComboBox();
			chkExportMobiFormat = new System.Windows.Forms.CheckBox();
			chkExportEpubFormat = new System.Windows.Forms.CheckBox();
			chkShowMobiEpubSelect = new System.Windows.Forms.CheckBox();
			cmdClose = new System.Windows.Forms.Button();
			fraMobiEpub.SuspendLayout();
			SuspendLayout();
			lblExport.AutoSize = true;
			lblExport.ForeColor = System.Drawing.SystemColors.MenuHighlight;
			lblExport.Location = new System.Drawing.Point(10, 60);
			lblExport.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			lblExport.Name = "lblExport";
			lblExport.Size = new System.Drawing.Size(144, 19);
			lblExport.TabIndex = 1;
			lblExport.Text = "Export these chapters:";
			Label1.AutoSize = true;
			Label1.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
			Label1.Location = new System.Drawing.Point(384, 60);
			Label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			Label1.Name = "Label1";
			Label1.Size = new System.Drawing.Size(191, 19);
			Label1.TabIndex = 1;
			Label1.Text = "Do not export these chapters:";
			cmbFilterList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbFilterList.FormattingEnabled = true;
			cmbFilterList.Location = new System.Drawing.Point(123, 23);
			cmbFilterList.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			cmbFilterList.Name = "cmbFilterList";
			cmbFilterList.Size = new System.Drawing.Size(228, 25);
			cmbFilterList.TabIndex = 2;
			cmdSave.Location = new System.Drawing.Point(650, 456);
			cmdSave.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			cmdSave.Name = "cmdSave";
			cmdSave.Size = new System.Drawing.Size(65, 31);
			cmdSave.TabIndex = 3;
			cmdSave.Text = "Save";
			ToolTip1.SetToolTip(cmdSave, "If you change the filter name before saving, it will create a new filter");
			cmdSave.UseVisualStyleBackColor = true;
			txtExportName.Location = new System.Drawing.Point(489, 460);
			txtExportName.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			txtExportName.Name = "txtExportName";
			txtExportName.Size = new System.Drawing.Size(156, 25);
			txtExportName.TabIndex = 4;
			cmdDelete.Location = new System.Drawing.Point(387, 23);
			cmdDelete.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			cmdDelete.Name = "cmdDelete";
			cmdDelete.Size = new System.Drawing.Size(103, 27);
			cmdDelete.TabIndex = 3;
			cmdDelete.Text = "Delete";
			cmdDelete.UseVisualStyleBackColor = true;
			lstExport.AllowDrop = true;
			lstExport.Columns.AddRange(new System.Windows.Forms.ColumnHeader[1]
			{
				ColumnHeader1
			});
			lstExport.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
			lstExport.Location = new System.Drawing.Point(10, 82);
			lstExport.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			lstExport.Name = "lstExport";
			lstExport.Size = new System.Drawing.Size(352, 317);
			lstExport.TabIndex = 5;
			lstExport.UseCompatibleStateImageBehavior = false;
			lstExport.View = System.Windows.Forms.View.Details;
			ColumnHeader1.Width = 300;
			lstDoNotExport.AllowDrop = true;
			lstDoNotExport.Columns.AddRange(new System.Windows.Forms.ColumnHeader[1]
			{
				ColumnHeader2
			});
			lstDoNotExport.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
			lstDoNotExport.Location = new System.Drawing.Point(387, 82);
			lstDoNotExport.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			lstDoNotExport.Name = "lstDoNotExport";
			lstDoNotExport.Size = new System.Drawing.Size(352, 317);
			lstDoNotExport.TabIndex = 5;
			ToolTip1.SetToolTip(lstDoNotExport, "Drag and drop from the other list to add");
			lstDoNotExport.UseCompatibleStateImageBehavior = false;
			lstDoNotExport.View = System.Windows.Forms.View.Details;
			ColumnHeader2.Width = 300;
			Label2.AutoSize = true;
			Label2.Location = new System.Drawing.Point(403, 462);
			Label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			Label2.Name = "Label2";
			Label2.Size = new System.Drawing.Size(82, 19);
			Label2.TabIndex = 6;
			Label2.Text = "Filter Name:";
			txtExportFilename.Location = new System.Drawing.Point(134, 406);
			txtExportFilename.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			txtExportFilename.Name = "txtExportFilename";
			txtExportFilename.Size = new System.Drawing.Size(228, 25);
			txtExportFilename.TabIndex = 4;
			Label3.AutoSize = true;
			Label3.Location = new System.Drawing.Point(10, 409);
			Label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			Label3.Name = "Label3";
			Label3.Size = new System.Drawing.Size(109, 19);
			Label3.TabIndex = 6;
			Label3.Text = "Export Filename:";
			Label4.AutoSize = true;
			Label4.Location = new System.Drawing.Point(383, 409);
			Label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			Label4.Name = "Label4";
			Label4.Size = new System.Drawing.Size(254, 19);
			Label4.TabIndex = 6;
			Label4.Text = "(Don't include the path or file extension)";
			Label5.AutoSize = true;
			Label5.Location = new System.Drawing.Point(18, 26);
			Label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
			Label5.Name = "Label5";
			Label5.Size = new System.Drawing.Size(89, 19);
			Label5.TabIndex = 6;
			Label5.Text = "Choose filter:";
			fraMobiEpub.Controls.Add(cmdEditMobiEpub);
			fraMobiEpub.Controls.Add(cmbExporters);
			fraMobiEpub.Controls.Add(chkExportMobiFormat);
			fraMobiEpub.Controls.Add(chkExportEpubFormat);
			fraMobiEpub.Location = new System.Drawing.Point(21, 491);
			fraMobiEpub.Name = "fraMobiEpub";
			fraMobiEpub.Size = new System.Drawing.Size(341, 85);
			fraMobiEpub.TabIndex = 15;
			fraMobiEpub.TabStop = false;
			fraMobiEpub.Visible = false;
			cmdEditMobiEpub.FlatStyle = System.Windows.Forms.FlatStyle.System;
			cmdEditMobiEpub.Location = new System.Drawing.Point(262, 22);
			cmdEditMobiEpub.Name = "cmdEditMobiEpub";
			cmdEditMobiEpub.Size = new System.Drawing.Size(66, 26);
			cmdEditMobiEpub.TabIndex = 6;
			cmdEditMobiEpub.Text = "Edit";
			cmdEditMobiEpub.UseVisualStyleBackColor = true;
			cmbExporters.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			cmbExporters.FormattingEnabled = true;
			cmbExporters.Location = new System.Drawing.Point(14, 22);
			cmbExporters.Name = "cmbExporters";
			cmbExporters.Size = new System.Drawing.Size(224, 25);
			cmbExporters.TabIndex = 5;
			chkExportMobiFormat.AutoSize = true;
			chkExportMobiFormat.Checked = true;
			chkExportMobiFormat.CheckState = System.Windows.Forms.CheckState.Checked;
			chkExportMobiFormat.Location = new System.Drawing.Point(14, 56);
			chkExportMobiFormat.Name = "chkExportMobiFormat";
			chkExportMobiFormat.Size = new System.Drawing.Size(120, 23);
			chkExportMobiFormat.TabIndex = 4;
			chkExportMobiFormat.Text = "Export to Mobi";
			chkExportMobiFormat.UseVisualStyleBackColor = true;
			chkExportEpubFormat.AutoSize = true;
			chkExportEpubFormat.Checked = true;
			chkExportEpubFormat.CheckState = System.Windows.Forms.CheckState.Checked;
			chkExportEpubFormat.Location = new System.Drawing.Point(157, 56);
			chkExportEpubFormat.Name = "chkExportEpubFormat";
			chkExportEpubFormat.Size = new System.Drawing.Size(119, 23);
			chkExportEpubFormat.TabIndex = 3;
			chkExportEpubFormat.Text = "Export to Epub";
			chkExportEpubFormat.UseVisualStyleBackColor = true;
			chkShowMobiEpubSelect.AutoSize = true;
			chkShowMobiEpubSelect.Location = new System.Drawing.Point(27, 464);
			chkShowMobiEpubSelect.Name = "chkShowMobiEpubSelect";
			chkShowMobiEpubSelect.Size = new System.Drawing.Size(140, 23);
			chkShowMobiEpubSelect.TabIndex = 16;
			chkShowMobiEpubSelect.Text = "Create Mobi/Epub";
			chkShowMobiEpubSelect.UseVisualStyleBackColor = true;
			cmdClose.Location = new System.Drawing.Point(611, 547);
			cmdClose.Name = "cmdClose";
			cmdClose.Size = new System.Drawing.Size(114, 29);
			cmdClose.TabIndex = 17;
			cmdClose.Text = "Close";
			cmdClose.UseVisualStyleBackColor = true;
			base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(755, 586);
			base.Controls.Add(cmdClose);
			base.Controls.Add(chkShowMobiEpubSelect);
			base.Controls.Add(fraMobiEpub);
			base.Controls.Add(Label4);
			base.Controls.Add(Label5);
			base.Controls.Add(Label3);
			base.Controls.Add(Label2);
			base.Controls.Add(lstDoNotExport);
			base.Controls.Add(lstExport);
			base.Controls.Add(txtExportFilename);
			base.Controls.Add(txtExportName);
			base.Controls.Add(cmdDelete);
			base.Controls.Add(cmdSave);
			base.Controls.Add(cmbFilterList);
			base.Controls.Add(Label1);
			base.Controls.Add(lblExport);
			Font = new System.Drawing.Font("Segoe UI", 10f);
			base.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
			base.Name = "frmPresets";
			Text = "Custom Exporter";
			fraMobiEpub.ResumeLayout(false);
			fraMobiEpub.PerformLayout();
			ResumeLayout(false);
			PerformLayout();
		}

		private void cmdSave_Click(object sender, EventArgs e)
		{
			if (txtExportName.Text.Length == 0)
			{
				Interaction.MsgBox("Please set the export name first");
				return;
			}
			string epubExporterName = "";
			if (chkShowMobiEpubSelect.Checked)
			{
				epubExporterName = cmbExporters.Text;
			}
			cProject.StoreCustomExport(txtExportName.Text, colExpIDs, txtExportFilename.Text, epubExporterName, chkExportMobiFormat.Checked, chkExportEpubFormat.Checked);
			FillCombo();
		}

		private void cmdDelete_Click(object sender, EventArgs e)
		{
			if (txtExportName.Text.Length == 0)
			{
				Interaction.MsgBox("Please set the export name first");
				return;
			}
			cProject.DeleteCustomExport(txtExportName.Text);
			FillCombo();
		}

		private void cmbSaved_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (SuppressUpdate)
			{
				return;
			}
			int num = cProject.cExports.IDByTitle(cmbFilterList.SelectedItem.ToString());
			if (num <= 0)
			{
				return;
			}
			clsExport clsExport = ((clsGenericBase<clsExport>)cProject.cExports).get_ByID(num);
			txtExportName.Text = clsExport.Title;
			txtExportFilename.Text = clsExport.Filename;
			colExpIDs.Clear();
			string[] aKAArray = clsExport.AKAArray;
			foreach (string text in aKAArray)
			{
				if (text.Length > 0)
				{
					colExpIDs.Add(Conversions.ToInteger(text), text);
				}
			}
			FillLists();
			string imageFile = clsExport.ImageFile;
			ComboBox cmbExporters = this.cmbExporters;
			clsEpub.SetExporterIndex(imageFile, ref cmbExporters);
			this.cmbExporters = cmbExporters;
		}

		private void lstExport_DragDrop(object sender, DragEventArgs e)
		{
			if (e.Effect != DragDropEffects.Move)
			{
				return;
			}
			string[] array = Strings.Split(Conversions.ToString(e.Data.GetData(DataFormats.Text)), "\t");
			foreach (string text in array)
			{
				if (text.Length > 0 && cProject.Chapters.Contains(Conversions.ToInteger(text)) && !colExpIDs.Contains(text))
				{
					colExpIDs.Add(Conversions.ToInteger(text), text);
				}
			}
			FillLists();
		}

		private void StartDrag(ref ListView List)
		{
			string text = "";
			IEnumerator enumerator = default(IEnumerator);
			try
			{
				enumerator = List.SelectedItems.GetEnumerator();
				while (enumerator.MoveNext())
				{
					int value = Conversions.ToInteger(((ListViewItem)enumerator.Current).Name);
					text = text + Conversions.ToString(value) + "\t";
				}
			}
			finally
			{
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
			}
			DoDragDrop(new DataObject(DataFormats.StringFormat, text), DragDropEffects.Move);
		}

		private void frmExportCustom_Load(object sender, EventArgs e)
		{
			IEnumerator enumerator = default(IEnumerator);
			try
			{
				enumerator = cProject.Chapters.GetEnumerator();
				while (enumerator.MoveNext())
				{
					clsChapter clsChapter = (clsChapter)enumerator.Current;
					colExpIDs.Add(clsChapter.ID, Conversions.ToString(clsChapter.ID));
				}
			}
			finally
			{
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
			}
			FillCombo();
			FillLists();
		}

		public void SetCurrentFilter(string FilterString)
		{
		}

		private void FillLists()
		{
			try
			{
				lstExport.Items.Clear();
				lstDoNotExport.Items.Clear();
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = cProject.Chapters.GetEnumerator();
					while (enumerator.MoveNext())
					{
						clsChapter clsChapter = (clsChapter)enumerator.Current;
						ListViewItem listViewItem = (!colExpIDs.Contains(clsChapter.ID)) ? lstDoNotExport.Items.Add(clsChapter.Title) : lstExport.Items.Add(clsChapter.Title);
						listViewItem.Name = Conversions.ToString(clsChapter.ID);
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
				string text = this.cmbExporters.Text;
				clsProject clsProject = cProject;
				ComboBox cmbExporters = this.cmbExporters;
				clsEpub.FillExporterCombo(clsProject, ref cmbExporters, text);
				this.cmbExporters = cmbExporters;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		public frmPresets(ref clsProject Project)
		{
			base.Load += frmExportCustom_Load;
			SuppressUpdate = true;
			colExpIDs = new clsCollection<int>();
			ExporterName = "";
			InitializeComponent();
			cProject = Project;
		}

		private void lstExport_DragOver(object sender, DragEventArgs e)
		{
			if (e.Data.GetDataPresent(DataFormats.StringFormat, autoConvert: false))
			{
				e.Effect = DragDropEffects.Move;
			}
		}

		private void lstExport_ItemDrag(object sender, ItemDragEventArgs e)
		{
			if (e.Button == MouseButtons.Left)
			{
				ListView List = lstExport;
				StartDrag(ref List);
				lstExport = List;
			}
		}

		private void lstDoNotExport_DragDrop(object sender, DragEventArgs e)
		{
			if (e.Effect != DragDropEffects.Move)
			{
				return;
			}
			string[] array = Strings.Split(Conversions.ToString(e.Data.GetData(DataFormats.Text)), "\t");
			foreach (string text in array)
			{
				if (text.Length > 0 && cProject.Chapters.Contains(Conversions.ToInteger(text)) && colExpIDs.Contains(text))
				{
					colExpIDs.Remove(text);
				}
			}
			FillLists();
		}

		private void lstDoNotExport_DragOver(object sender, DragEventArgs e)
		{
			if (e.Data.GetDataPresent(DataFormats.StringFormat, autoConvert: false))
			{
				e.Effect = DragDropEffects.Move;
			}
		}

		private void lstDoNotExport_ItemDrag(object sender, ItemDragEventArgs e)
		{
			if (e.Button == MouseButtons.Left)
			{
				ListView List = lstDoNotExport;
				StartDrag(ref List);
				lstDoNotExport = List;
			}
		}

		private void lstExport_SelectedIndexChanged(object sender, EventArgs e)
		{
		}

		private void FillCombo()
		{
			SuppressUpdate = true;
			cmbFilterList.Items.Clear();
			IEnumerator enumerator = default(IEnumerator);
			try
			{
				enumerator = cProject.cExports.GetEnumerator();
				while (enumerator.MoveNext())
				{
					clsExport clsExport = (clsExport)enumerator.Current;
					cmbFilterList.Items.Add(clsExport.Title);
				}
			}
			finally
			{
				if (enumerator is IDisposable)
				{
					(enumerator as IDisposable).Dispose();
				}
			}
			SuppressUpdate = false;
		}

		private void cmdClose_Click(object sender, EventArgs e)
		{
			Hide();
		}

		private void chkMobiEpub_CheckedChanged(object sender, EventArgs e)
		{
			fraMobiEpub.Visible = chkShowMobiEpubSelect.Checked;
		}

		private void cmbExporters_SelectedIndexChanged(object sender, EventArgs e)
		{
			ExporterName = cmbExporters.Text;
		}

		private void cmdEditMobiEpub_Click(object sender, EventArgs e)
		{
			try
			{
				new frmMobiEpub(ref cProject).ShowDialog();
				string text = this.cmbExporters.Text;
				clsProject clsProject = cProject;
				ComboBox cmbExporters = this.cmbExporters;
				clsEpub.FillExporterCombo(clsProject, ref cmbExporters, text);
				this.cmbExporters = cmbExporters;
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}
	}
}
